home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc A) / Acorn User China CD-ROM (UK) (Disc A).bin / DEMON / ACORN-FILES / TECHNOTE.ARC / Text
Encoding:
Text File  |  1995-08-14  |  22.5 KB  |  494 lines

  1. -----------------------------------------------------------------------------
  2. 11th August 1995
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 283
  6. Issue: 1.01
  7. Author: DW
  8. -----------------------------------------------------------------------------
  9. TCP/IP Addressing, Subnetworking and Interoperability: an Overview
  10. -----------------------------------------------------------------------------
  11. Notes: 
  12.  
  13. This document describes the different types of network address available in
  14. the IP world, and how they may be subdivided using IP netmasks. The concept
  15. of "special" IP addresses is also introduced, the "special" addresses which
  16. must not be assigned to machines are listed, and the procedures required to
  17. allow TCP/IP to interoperate with AUN are detailed.
  18. -----------------------------------------------------------------------------
  19. Applicable Hardware: 
  20.  
  21. All hardware attached to an IP network
  22.  
  23. Related Application Notes: 
  24.  
  25.  
  26. -----------------------------------------------------------------------------
  27. Copyright (C) 1995 Acorn Computers Limited 
  28.  
  29. Every effort has been made to ensure that the information in this leaflet is 
  30. true and correct at the time of printing. However, the products described in
  31. this leaflet are subject to continuous development and improvements and
  32. Acorn Computers Limited reserves the right to change its specifications at
  33. any time. Acorn Computers Limited cannot accept liability for any loss or
  34. damage arising from the use of any information or particulars in this
  35. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  36. Limited.
  37. -----------------------------------------------------------------------------
  38. Support Group
  39. Acorn Computers Limited
  40. Acorn House
  41. Vision Park
  42. Histon
  43. Cambridge
  44. CB4 4AE                                                  
  45. -----------------------------------------------------------------------------
  46.  
  47. Introduction
  48. ------------
  49. TCP/IP, the Transmission Control Protocol / Internet Protocol, is a world
  50. standard underlying protocol for communication between networks of
  51. computers; IP has been implemented on most operating systems (including RISC
  52. OS), and the Internet uses it exclusively. 
  53.  
  54. As befits a protocol capable of supporting such a complex organism as the
  55. Internet, IP is itself not simple; a full internetworking "stack" comprises
  56. hardware control layers,  IP, TCP, UDP and any combination of the wide range
  57. of communication protocols which themselves need the underlying IP system to
  58. operate. An example of a full internetworking protocol stack is pictured
  59. below; although we only intend to cover the IP layer and its interface to
  60. the hardware drivers and the internetwork in this Application Note, it is
  61. intended that some of the higher-level protocols, their configuration and
  62. use will be covered in a future document.
  63.  
  64. <Insert drawFiles.Fig1>
  65.  
  66. Figure 1: A Full Internetworking Protocol Stack
  67.  
  68.  
  69. Internet Protocol
  70. -----------------
  71. Background: Network Classes
  72. ---------------------------
  73. IP addresses are divided into five address classes, categorised as A to E.
  74.  
  75. The first three classes, A, B and C, are available for normal allocation and
  76. for server-to-server communications. Class D is reserved for multicast
  77. systems (support within the DCI4 suite allows specifically addressed
  78. multicast packets to be passed, but has no mechanism provided to allow finer
  79. granularity than "all multicasts or none at all"), and Class E currently
  80. has experimental status only. 
  81.  
  82. Class E is likely to become important, however, in that is is earmarked for
  83. future use with single-machine domains (ie home users, and educational
  84. establishments with just one machine connected to the Internet); the
  85. importance of Class E is likely to be emphasised significantly in the next
  86. revision of the Internet Standards documents.
  87.  
  88. There are no practical distinctions in the way in which computer systems
  89. with class A, class B or class C addresses use these addresses. With some
  90. exceptions (covered in the "Special Addresses" section below), all addresses
  91. are equivalent for communication purposes.
  92.  
  93. The distinguishing feature of each class of address is the number of network
  94. numbers, and the number of host connections which each of those network
  95. numbers can support. These restrictions are detailed below:
  96.  
  97. <Insert DrawFiles.Table1>
  98.  
  99. Table 1: Network Classes and Restrictions
  100.  
  101. Background: IP Addressing  
  102. -------------------------
  103. An IP address takes the form of a 32-bit binary number, which must be unique
  104. throughout the whole of the connected network. To make the address more
  105. easily readable by humans, it is often represented in "dotted decimal" form
  106. as a.b.c.d, where each of a, b, c and d is a decimal number in the range
  107. 0-255. 
  108.  
  109. The 32-bit IP address has two fundamental components; a network number and a
  110. host number. An optional subnetwork number may also be explicitly inserted
  111. in the address; this is dependent on the subnetwork mask, discussed later.
  112.  
  113. The network number appears at the left hand side (MSB) of the IP address,
  114. and contains some bits which can be used to deduce the class of the network
  115. associated with the number. In brief:
  116.  
  117. • If the most significant bit in the most significant byte is 0, the address
  118.   is class A
  119.  
  120. • If the two most significant bits in the most significant byte are 10, the
  121.   address is class B
  122.  
  123. • If the three most significant bits in the most significant byte are 110,
  124.   the address is class C
  125.  
  126. • If the four most significant bits in the most significant byte are 1110,
  127.   the address is Class D 
  128.  
  129. • If the four most significant bits in the most significant byte are 1111,
  130.   the address is Class E
  131.  
  132. It is worth clarifying what constitutes a "host" in the usual situation of a
  133. machine running one network stack and having one network card, a host can be
  134. thought of as a single machine. However, machines which have more than one
  135. physical network interface (eg systems which are configured as gateways)
  136. have as many host connections as they have network connections to gateway
  137. between, and a multiple-personality system running multiple IP stacks under
  138. different operating systems (eg a Risc PC using the DCI4 interface so that
  139. it can run !Internet from RISC OS and some other stack implemented in
  140. whatever OS is running in the 486 environment) has as many host IDs as it
  141. has IP stacks. 
  142.  
  143. Unlike some other large-scale schemes which assign numbers to devices (a
  144. classic case being the public telephone network), IP addresses contain no
  145. information which gives any clues regarding the geographical location of the
  146. device which owns the IP address;  IP addresses are not hierarchical. Given
  147. an IP address, the only thing you can deduce from it is a management
  148. auhority; that authority could manage one network which itself has global
  149. coverage and intermeshes with many other networks.
  150.  
  151. Choosing Network Numbers
  152. ------------------------
  153. The choice of network numbers is very important in relation to the way in
  154. which your network is routed, and there are a few simple rules which should
  155. be obeyed:
  156.  
  157. • Network connections with the same network number should communicate
  158.   directly on the same physical LAN.
  159.  
  160. • Network connections with different network numbers do not communicate
  161.   directly; they must use the services of a router. The router can either be 
  162.   directly connected to the LANs which supplied and which need to receive 
  163.   the packet, or it may be connected via a number of indirect steps (ie other 
  164.   routers) to a router which knows about the LAN which needs to receive the 
  165.   packet.
  166.  
  167. It is strongly recommended that, if you are planning to connect your own
  168. IP-running network to someone else's at any point, that you apply to have an
  169. address registered for your site.
  170.  
  171. "Special" Addresses
  172. -------------------
  173. There are a number of IP addresses which are reserved for particular special
  174. functions. These addresses are listed below; such addresses must NEVER be
  175. assigned to a computer as the host IP address.
  176.  
  177. • 127.n.n.n, where n.n.n is any set of numbers. This is reserved for local
  178.   software loopback. Note that IAB standards say that any address beginning
  179.   with 127 must not be transmitted across the physical interface or appear on
  180.   the cable. As not all software implementations check IP addresses before
  181.   transmitting, some IP datagrams with source or destination address of
  182.   127.<something> may appear on the cable; this has been known to cause
  183.   networks to fail.
  184.  
  185. • A network number of all 1s
  186.  
  187. • Host number 0 is reserved to refer to a particular network number. For
  188.   example, the first class C address which can be allocated is 192.0.0.1
  189.  
  190. • The IP address 0.0.0.0 is reserved, and considered to be classless. It is
  191.   used in two ways: as a secure address when the system does not know its
  192.   genuine address (eg during the bootstrap phase of a UNIX workstation booting
  193.   across a network, when the station does not know the true network address of
  194.   that network) and by routers in a list of addresses to advertise the default
  195.   route, this being the route to all networks which are not explicitly
  196.   otherwise listed. Note that this "default route" is not a source or
  197.   destination address, merely an entry in a table.
  198.  
  199. • The IP address 255.255.255.255 is reserved as a destination address to
  200.   mean "broadcast this packet to all other systems on this network." 0.0.0.0
  201.   as a destination is an obsolete form of 255.255.255.255.
  202.  
  203. If one or more of these addresses are assigned to your networked machines,
  204. the errors which will occur are likely to be obscure, apparently
  205. intermittent and difficult to isolate; remember that not all network
  206. software checks to see that the IP address it is requested to use is a valid
  207. one.
  208.  
  209. You should also note that, once you start introducing subnetworking, other
  210. IP addresses become reserved, and assigning these addresses to machines can
  211. cause very similar problems; more details of this follow later.
  212.  
  213. The Reason for Netmasks: Subdivision of Networks
  214. ------------------------------------------------
  215. Subnetworking increases the network manager's control over the network
  216. address space, and provides a mechanism for using routers when only one or a
  217. small number of full network numbers is available. The mechanism for
  218. creating subnetworks is the subnetwork mask (or Netmask); this is another
  219. 32-bit number which is allocated at the same time as the IP address.
  220.  
  221. Subnetworking divides the normal range of host IDs (16 million for class A,
  222. 65534 for class B and 254 for class C) into a number of subnetworks, with a
  223. reduced number of systems on each subnetwork. The product of the number of
  224. subnetworks and the (number of stations + 1) on each subnetwork cannot
  225. exceed the number of stations which could live on the original, undivided
  226. network.
  227.  
  228. When planning a large new network installation (where "large" implies more
  229. than 200 stations on the network) which is intended to be connected to the
  230. Internet, it pays dividends to plan for subnetworking even if the facility
  231. is not used initially; in addition to the labour-intensive nature of
  232. changing the large number of addresses which will require changing if
  233. subnetworking is introduced to a network which has not been prepared for it,
  234. it is highly unlikely that your organisation would be allocated more than
  235. one network number.
  236.  
  237. Of course, there are limitations imposed by the basic structure of Class A,
  238. B and C network addresses; there cannot be a greater number of connections
  239. than the basic address type will permit, and in practice you will always
  240. have slightly fewer available addresses owing to certain addresses becoming
  241. reserved. 
  242.  
  243. What you lose in raw numbers of connections, however, you gain in
  244. flexibility and control.
  245.  
  246. Small networks which do not use routers need not use subnetworking, if such
  247. networks are unlikely to grow beyond a few physical LANs and up to 200
  248. stations. If you do not need to use a registered address and therefore do
  249. not mind how many IP network numbers you use, then there is less incentive
  250. to use subnetwork addressing. 
  251.  
  252. Interaction of the IP Address and the Netmask
  253. ---------------------------------------------
  254. Like the IP address itself, the subnetwork mask is a 32 bit number. The
  255. interaction between the two numbers works according to the following rule:
  256.  
  257. • If there is a 1 in a bit position in the subnetwork mask, that bit forms
  258.   part of the network number in the network address space
  259.  
  260. • If there is a 0 in a bit position in the subnetwork mask, that bit is part
  261.   of the host IP address.
  262.  
  263. An example of the use of a subnetwork mask is given below:
  264.  
  265.  
  266.    Table 2: Interaction of IP Address, Network ID and Netmask
  267.  
  268. The IP address AND NOT (the subnet mask) is the host ID, and the IP address
  269. AND the subnet mask is the network ID. In this case, the site has an
  270. assigned network ID of 129.130.0.0 (class B) and is using subnetworking to
  271. generate the network 129.130.72.0. 
  272.  
  273. If you choose not to use subnetworking, you will still need to insert the
  274. default subnetwork masks which select the normal network numbers. The
  275. default masks are:
  276.  
  277. <Insert DrawFiles.Table3>
  278.  
  279. Table 3: Default Subnet Masks by Network Class
  280.  
  281. Reserved Subnet Numbers
  282. -----------------------
  283. Health Warning: This section is somewhat mind-bending, and is only necessary
  284. for a complete understanding of the limitations in allocating subnet
  285. numbers; it may be glossed over on a first reading of this document.
  286.  
  287. Subnetting is further complicated by the fact that an address of all 1s is
  288. used for broadcasts to all subnets within a network. A host ID of "all 1s"
  289. is still the broadcast to all systems, either on a specific subnetwork or
  290. all subnets with this network. This reduces the number of available
  291. addresses to assign to hosts. 
  292.  
  293. A subnet mask of 255.255.128.0 it is not useful, as 128.1.0.n refers to
  294. "system n on this subnetwork" (see Table 4) and 128.1.255.255, which would
  295. be a broadcast to all hosts on 128.1.128.0, also  means "broadcast to all
  296. hosts on the network 128.1.0.0". 
  297.  
  298. Additionally, 128.1.255.255 could be used to mean "broadcast to all hosts on
  299. the subnet 128.1.128.0"; this condition is illustrated in Table 5. As the
  300. two conditions are indistinguishable, this subnet cannot be used.
  301.  
  302. <Insert DrawFiles.Table4>
  303.  
  304. Table 4: The Significance of 128.1.0.n
  305.  
  306. <Insert DrawFiles.Table5>
  307.  
  308. Table 5: Anatomy of a Broadcast Address Clash
  309.  
  310. The first mask which can be used is the next mask of 255.255.192.0 giving
  311. four subnet values, but only two usable subnetwork numbers of 128.1.64.0 and
  312. 128.1.128.0. While 128.1.192.0 at first seems usable, the address
  313. 128.1.255.255 again means "broadcast to all hosts on network number
  314. 128.1.0.0". There is no separate way of defining a broadcast to all systems
  315. on the single subnet 128.1.192.0. Any address 128.1.0.n refers to system n
  316. on "this subnet," instead of on the specified subnet 128.1.0.0, so that
  317. subnet is also unusable.
  318.  
  319. The subnet 0 should not be used, since  0 refers to the network as a whole,
  320. and is inherently associated with the broadcast address, even though this
  321. usage is now deprecated.
  322.  
  323. When represented in dotted decimal, it can be very difficult to recognise
  324. the broadcast address for a single subnet; it is often better to do most of
  325. the working out of subnet allocations in binary or hex, and convert back to
  326. decimal if required as the last stage.
  327.  
  328. Choosing a Netmask
  329. ------------------
  330. Address management is much simpler if the same subnet mask is configured on
  331. all systems which share a particular network number. When you choose your
  332. netmask, you must bear in mind that it defines the point in the final IP
  333. address where host numbers are replaced by network numbers; to avoid
  334. complications later on, it is strongly recommended that you choose your
  335. netmask to be a contiguous block of 1s followed by a contiguous block of 0s,
  336. as in the example in Table 2. Hosts on different subnetworks require an
  337. intervening router, so changing the subnet mask may equally be thought of as
  338. exchanging repeaters for routers. Before choosing the subnet boundary, you
  339. need to know:
  340.  
  341. • how big the largest subnetwork is which you can manage using repeaters alone
  342.  
  343. • what the cost, performance and management overheads are in using routers
  344.   in select places on your network in place of repeaters
  345.  
  346. The importance of these issues is that, for a network with a single subnet
  347. mask, all subnetworks will have the same maximum size. For a class B
  348. network, for example, most managements would be likely to choose from:
  349.  
  350. • 254 subnets of 254 hosts
  351. • 126 subnets of 510 hosts
  352. • 62 subnets of 1022 hosts
  353. • 30 subnets of 2046 hosts
  354.  
  355. These figures produce an acceptable balance between repeaters and routers;
  356. the same subnetting principles apply to the smaller scale of a class C
  357. address, although there will of course be a smaller number of hosts
  358. addressable. 
  359.  
  360. TCP/IP and AUN
  361. --------------
  362. AUN (without the full TCP/IP suite in coexistence) at DCI2 level operates
  363. using the InternetA module; essentially, an AUN packet propagating across
  364. Ethernet comprises an Econet packet wrapped up in an IP header. AUN takes
  365. the approach of using class A IP addresses with a class B subnet mask, with
  366. the result that the IP address of an AUN station looks like:
  367.  
  368. <Insert DrawFiles.Fig2>
  369.  
  370. Figure 2: Composition of an AUN address as seen by TCP/IP
  371.  
  372. The "network address" is related to the number of the individual LAN
  373. containing the required station, and which is bridged into the single
  374. visible network.
  375.  
  376. It is worth noting here that the InternetA module, which forms part of the
  377. DCI2 !Bootnet application (supplied as part of AUN Level 4) has the first
  378. field of its dotted decimal representation hardwired to 1. If you wish to
  379. have a link of any form between such a network and the Internet, you will
  380. need to gateway the system in such a manner that the Internet (or whatever
  381. other IP-supporting network you are connecting to) cannot see the full IP
  382. addresses of the machines on the network running InternetA. Alternatively,
  383. you can replace InternetA with the full Internet module (contained as part
  384. of the new DCI4 suite, which has been released by Acorn as freeware and is
  385. available by anonymous ftp from ftp.acorn.co.uk and mirror sites) and hence
  386. remove the hardwiring problem. This may be done in a boot sequence by simply
  387. disabling the AUN client software and running !Internet and !Bootnet in that
  388. order. However, with this software loaded, it is not possible to use the
  389. !Gateway application.
  390.  
  391. It is necessary to ensure that mapping between the two-byte net.station
  392. addresses used by AUN and the four-byte site.network.net.station IP
  393. addresses is set up correctly; this is achieved by explicitly mapping AUN
  394. nets to IP net addresses in the !Bootnet.Files.AddMaps file, detailed in the
  395. "AUN and TCP/IP" appendix of the AUN Manager's Guide. The format of this
  396. file consists of a series of lines having the syntax
  397.  
  398. addmap byte1.byte2.byte3.0 net
  399.  
  400. where byte1, byte2 and byte3 are the first three bytes of an IP network
  401. address and net is the number of the AUN net which is to correspond to that
  402. network. Individual station numbers are preserved, hence the command
  403.  
  404. addmap 1.1.129.0 130 
  405.  
  406. would cause the AUN address of 130.57 to be translated to the IP address of
  407. 1.1.129.57
  408.  
  409. Note that, as addmap maps one net number onto another net number, the final
  410. byte in the IP address referenced in an addmap command must be 0. Any other
  411. value will produce unexpected results.
  412.  
  413. Addmap is capable of supporting IP addresses beyond the InternetA network
  414. address restrictions, so all classes of IP network can have AUN addresses
  415. associated with them.
  416.  
  417. Example: Subnetting a Class A Network for IP and AUN
  418. ----------------------------------------------------
  419. The example of a class A network is being used for two reasons, these being
  420. that many sites who decide that they will never need to connect their
  421. internal network to any external systems will gain more flexibility from
  422. using a class A addressing scheme, and because (as detailed above) AUN
  423. imposes a class A scheme by default.
  424.  
  425. An AUN network gives the sysadmin the base network address of 1.0.0.0 to
  426. work from; the class B subnetting AUN uses gives a default netmask of
  427. 255.255.0.0 to work with. If you look at this from a purely IP viewpoint and
  428. consider the default netmask, then the second-most significant byte in the
  429. network address appears as though it can never change; however, in AUN the
  430. software integral to !Gateway determines the value of this byte (and for
  431. Ethernet networks, the third byte too), independently of the rest of the
  432. system. If Econet is still in use and the station in question is connecting
  433. using Econet or another Econet-like protocol (indicated by an AUN net
  434. address <128), the second byte is determined by !Gateway and the third is
  435. determined by an Econet bridge.
  436.  
  437. If you plan to use !Gateway, you must ensure that the only IP packets which
  438. will be passing through the !Gateway machine have an address of 1.n.n.n;
  439. otherwise you will have to use a third-party gateway system which supports
  440. the range of IP addresses appropriate to your network.
  441.  
  442. Once the subnetting has been set up in the IP universe (the netmask is
  443. usually left at FFFF0000, and any necessary changes in the second byte are
  444. determined by gateways), AUN routing can be set up using addmap as above. IP
  445. routing, where applicable, needs to be done using the route command; this is
  446. documented in the TCP/IP User Guide and Application Note 284.
  447.  
  448. Integrating TCP/IP and Acorn Access
  449. -----------------------------------
  450. This requires the building of a two stage boot sequence which includes a
  451. file which is accessed before the desktop is active and a file which is
  452. called when the desktop becomes active.
  453.  
  454. If a !Boot file; of type Desktop, already exists then rename it as Desktop.
  455.  
  456. Using !Edit create an Obey file which contains the following lines (amending
  457. the application pathnames where necessary):
  458.  
  459. RMKill ShareFs      
  460. RMKill Freeway      
  461. RMKill AccMsgs 
  462. RMKill InternetA        
  463. Filer_Run ADFS::4.$.Network.!Internet      
  464. Filer_Run ADFS::4.$.Network.!BootNet      
  465.  
  466. RMReinit AccMsgs      
  467. RMReinit Freeway      
  468. RMReinit ShareFs      
  469. Desktop -f ADFS::4.$.Desktop | Used if there is a Desktop file      
  470. |Desktop | Used if there isn’t a Desktop file.
  471.  
  472. Note:   The pathnames to the applications and files may vary according to
  473. the disc structure used. The order in which the modules are *RMReinit-ed is
  474. vital.
  475.  
  476. Save this file as !Boot and reset the machine.
  477.  
  478.  
  479. Required Reading
  480. ----------------
  481. Acorn Computers Ltd, "TCP/IP Protocol Suite Installation Guide"
  482. The DCI4 equivalent of this document is supplied in plaintext form in the
  483. "Docs" supdirectory which comprises part of the DCI4 stack distribution
  484. archive, downloadable from ftp.acorn.co.uk
  485.  
  486. Further Reading
  487. ---------------
  488. Washburn and Evans, "TCP/IP, Running a Successful Network" (Addison-Wesley) 
  489. 1993 
  490.  
  491. Hegering and Läpple, "Ethernet - Building a Communications Infrastructure" 
  492. (Addison-Wesley)
  493.  
  494. O'Reilly, "TCP/IP Network Administration" (O'Reilly)